#ifndef _IQ_H_
#define _IQ_H_

#include <packet/Packet.h>
/**
 * The base IQ (Info/Query) packet. IQ packets are used to get and set information
 * on the server, including authentication, roster operations, and creating
 * accounts. Each IQ packet has a specific type that indicates what type of action
 * is being taken: "get", "set", "result", or "error".<p>
 *
 * IQ packets can contain a single child element that exists in a specific XML
 * namespace. The combination of the element name and namespace determines what
 * type of IQ packet it is. Some example IQ subpacket snippets:<ul>
 *
 *  <li>&lt;query xmlns="jabber:iq:auth"&gt; -- an authentication IQ.
 *  <li>&lt;query xmlns="jabber:iq:private"&gt; -- a private storage IQ.
 *  <li>&lt;pubsub xmlns="http://jabber.org/protocol/pubsub"&gt; -- a pubsub IQ.
 * </ul>
 *
 * @author Matt Tucker
 */
class IQ : public Packet {
public:
	IQ();

	/**
     * A class to represent the type of the IQ packet. The types are:
     *
     * <ul>
     *      <li>IQ.Type.GET
     *      <li>IQ.Type.SET
     *      <li>IQ.Type.RESULT
     *      <li>IQ.Type.ERROR
     * </ul>
     */
	typedef enum {
		IQ_TYPE_GET,
		IQ_TYPE_SET,
		IQ_TYPE_RESULT,
		IQ_TYPE_ERROR
	} TYPE;

	TYPE getType() { return type;}
	
    /**
     * Sets the type of the IQ packet.
     *
     * @param type the type of the IQ packet.
     */
    void setType(TYPE type) ;
	
	std::string toXML();
	
    /**
     * Returns the sub-element XML section of the IQ packet, or <tt>null</tt> if there
     * isn't one. Packet extensions <b>must</b> be included, if any are defined.<p>
     *
     * Extensions of this class must override this method.
     *
     * @return the child element section of the IQ XML.
     */
	virtual std::string getChildElementXML() = 0;




	
private:
	TYPE type;
};

#endif // -- _IQ_H_
